package com.hz.ruoyilgorder.api.controller;

import com.hz.ruoyilgorder.service.LgDeliveryInfoService;
import com.hz.ruoyilgorder.service.LgDriverLogisticsService;
import com.hz.ruoyilgorder.service.LgOutOrderService;
import com.hz.ruoyilgorder.utils.ResultJSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @version 1.0
 * @Author yzw
 * @Date 2025/3/12 11:15
 * @注释  高建 api
 */

@RestController
@RequestMapping("/api")
public class LgDriverApi {
    @Autowired
    private LgDriverLogisticsService lgDriverLogisticsService;
    @Autowired
    private LgDeliveryInfoService lgDeliveryInfoService;
    @Autowired
    private LgOutOrderService lgOutOrderService;

    @GetMapping("/list")
    //司机接货，也就是卖家下的单
    public ResultJSON getnews( @RequestParam("driverId") Integer driverId ){
//        System.out.println("--++++++++++++++++"+driverId);
        return ResultJSON.success(lgDriverLogisticsService.getnews(driverId));
    }

    @GetMapping("/listgetoutcold")
    //卖家出库
    public ResultJSON getoutcold( @RequestParam("driverId") Integer driverId ){
        //System.out.println("--++++++++++++++++"+driverId);
        return ResultJSON.success(lgDeliveryInfoService.getoutcold(driverId));
    }

    @GetMapping("/buyList")
    public ResultJSON getBuyList(@RequestParam("buyerPhone")String buyerPhone){
        return ResultJSON.success(lgOutOrderService.querybuyer(buyerPhone));
    }

    //修改司机状态

}
